package andanyoung.springcloudalibaba.orderservice.dto;

import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

//消费者端接收响应Stock对象
@Data
@NoArgsConstructor
public class Stock implements Serializable {

    private static final long serialVersionUID = -6716438666862245095L;
    //商品品类编号
    private Long skuId;
    //商品与品类名称
    private String title;
    //库存数量
    private Integer quantity;
    //单位
    private String unit;

    public Stock(Long skuId, String title, Integer quantity, String unit) {
        this.skuId = skuId;
        this.title = title;
        this.quantity = quantity;
        this.unit = unit;
    }

    @Override
    public String toString() {
        return "Stock{" +
                "skuId=" + skuId +
                ", title='" + title + '\'' +
                ", quantity=" + quantity +
                ", unit='" + unit + '\'' +
                '}';
    }
}
